package co.com.javeriana.aes.oms.ldap.client;

/**
 *
 * @author Jonathan Fernandez <jonathan.fvargas@gmail.com>
 */
public class LdapClient {

    public static boolean validateUser(java.lang.String userName, java.lang.String password) {
        boolean result = false;
        try {
            // Call Web Service Operation            
            co.com.javeriana.aes.oms.ldap.client.OmsAuthWebService_Service service = new OmsAuthWebService_Service();
            co.com.javeriana.aes.oms.ldap.client.OmsAuthWebService port = service.getOmsAuthWebServicePort();
            result = port.validateUser(userName, password);
        } catch (Exception ex) {
            // TODO handle custom exceptions here
        }
        return result;
    }
    
    public static String getUserPermission(java.lang.String userName, java.lang.String password) {
        String result = null;
        try {
            // Call Web Service Operation            
            co.com.javeriana.aes.oms.ldap.client.OmsAuthWebService_Service service = new OmsAuthWebService_Service();
            co.com.javeriana.aes.oms.ldap.client.OmsAuthWebService port = service.getOmsAuthWebServicePort();
            result = port.getUserPermission(userName, password);
        } catch (Exception ex) {
            // TODO handle custom exceptions here
        }
        return result;
    }

    public static void main(String args[]) {

        System.out.println(validateUser("jonathan", "jfernandez123"));
        System.out.println(getUserPermission("juan", "juan"));
        

    }

}
